
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>这里是首页</title>
</head>
<style>
    body{
        text-align: center;
        background-color: deepskyblue;
    }
    .dv1{
        padding-bottom:20px;
    }
    table{
        width: 500px;
        margin: 0 auto;
        text-align: center;
    }
    form{
        text-align: center;
    }
    td{
        border:1px rgba(0,0,0,0.2) solid;
    }
    tr:nth-child(even){
        background-color:lightskyblue;
    }
    tr:nth-child(odd){
        background-color: aquamarine;
    }
    tr:hover{
        background-color: pink;
    }
    tr:first-child{
        background-color: blueviolet;
    }
    button:hover{
        background-color: coral;
    }
</style>
<body>
<div><h1>欢迎${username}</h1></div>
<div class="dv1"><b>手机管理系统</b></div>

<form action="ServletPhone" method="Post">
    名称查询：<input style="background-color: #00FFFF" type="text" name="selectname" placeholder="输入名称查询"/>
    <input style="background-color: aquamarine" type="submit" value="查询"/>
</form>
        <table cellspacing="0" cellspacing="collapse">
            <tr>
                <td>序号</td>
                <td>编号</td>
                <td>名称</td>
                <td>价格</td>
                <td style="text-align:center">操作</td>
            </tr>
            <c:forEach var="phone" items="${phone}">
                <tr>
                    <td>${phone.id}</td>
                    <td>${phone.no}</td>
                    <td>${phone.name}</td>
                    <td>${phone.price}</td>
                    <td>
                        <span style="padding:15px"><a href="updateServlet?id=${phone.id}&no=${phone.no}&name=${phone.name}&price=${phone.price}">更新</a></span>
                        <span style="padding:15px"><a href="deleteServlet?id=${phone.id}">删除</a></span>
                    </td>
                </tr>
            </c:forEach>
        </table>
            <div style="margin-top: 20px"><a href="add.jsp"><button style="background-color: aquamarine">添加</button></a></div>
</body>
</html>
